import pandas as pd

import json


# 使用python JSON模块载入数据
with open('nested_list.json','r') as f:
    data = json.loads(f.read())


# 展平数据
df_nested_list = pd.json_normalize(data,record_path=['students'])
print(df_nested_list)


print("="*50)
df_nested_list2=pd.json_normalize(data,record_path=['students'],meta=['school_name','class'])
print(df_nested_list2)